
//引入vue
import Vue from "vue";
//引入vueRouter
import VueRouter from "vue-router";
//引组件
import About from "@/pages/About";
import Home from '@/pages/Home';
import News from "@/pages/News";
import Message from "@/pages/Message";
import Detail from "@/pages/Detail";
//使用vue路由插件
Vue.use(VueRouter)
//实例化VueRouter 配置配置对象
export default new VueRouter({
  //配置路由表
  routes: [
    {
      path: '/about',
      component: About
    },
    {
      path: '/home',
      component: Home,
      children: [
        {
          path: 'news',
          component: News
        },
        {
          path: 'message',
          component: Message,
          children: [
            {
              path: 'detail',
              component: Detail,
              name:"detail"
            }
          ]
        }
      ]
    }
  ]
})